/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
 */
#ifndef __HOT_REPLACE_H
#define __HOT_REPLACE_H

#include <linux/kvm_host.h>
#include <linux/errno.h>

#ifdef CONFIG_HOTREPLACE
int kvm_hot_replace_init(void);
int kvm_hot_replace_share_ram_block(struct kvm *kvm,
					struct kvm_share_ram_block *ram);
int kvm_hot_replace_set_skip_notifier(struct kvm *kvm, int skip_notifier);
int kvm_hot_replace_load_vfio_post(struct kvm_vcpu *vcpu, int fd);
#else
static inline int kvm_hot_replace_init(void)
{
	return 0;
}

static inline int kvm_hot_replace_share_ram_block(struct kvm *kvm,
					struct kvm_share_ram_block *ram)
{
	return -EOPNOTSUPP;
}

static inline int kvm_hot_replace_set_skip_notifier(struct kvm *kvm,
						    int skip_notifier)
{
	return 0;
}

static inline int kvm_hot_replace_load_vfio_post(struct kvm_vcpu *vcpu, int fd)
{
	return 0;
}
#endif

#endif
